#include "ThreadClass.h"

#include "../../tdreamsock/dreamSockLog.h"
#include "../game/game.h"

ThreadClass::ThreadClass()
{
} 
ThreadClass::~ThreadClass()
{
} 

void ThreadClass::RunReceiveDatagramPackets(Game* game) {
	while(true)
	{
		game->RunReceiveDatagramPackets();
		long milliseconds = 2;
		boost::this_thread::sleep(boost::get_system_time() + 
        boost::posix_time::milliseconds( std::max<long>(milliseconds,0) ) );
	}
}

void ThreadClass::RunGameLoop(Game* game) {
    game->go();
	
	while(true)
	{
		game->gameLoop();
	}
}